﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZOIL.DataBackend;

namespace ZOIL.Library.Components//Library.Components.ViPostIt
{
    public class ViPostIt : DInformationObject, IRemoteUpdateable
    {
        public ViPostIt(int pageID) 
            : base() //WTF base??
        {
            this.PageID = pageID;
        }

        //new Proberties set here & in ViPostItViewModel

        //public Int32 Id
        //{
        //    get
        //    {
        //        return GetValue<Int32>("ViPostIt:Id");
        //    }
        //    set
        //    {
        //        SetValue("ViPostIt:Id", value);
        //        RaisePropertyChangedEvent("Id");
        //    }
        //}

        public int? PageID
        {
            get
            {
                return (int?)GetValue("ViPostIt:PageID");
            }
            set
            {
                SetValue("ViPostIt:PageID", value);
                RaisePropertyChangedEvent("PageID");
            }
        }


        public Uri SmallUrl
        {
            get
            {
                return GetValue<Uri>("ViPostIt:SmallUrl");
            }
            set
            {
                SetValue("ViPostIt:SmallUrl", value);
                RaisePropertyChangedEvent("SmallUrl");
            }
        }

        public String Title
        {
            get
            {
                return GetValue<String>("ViPostIt:Title");
            }
            set
            {
                SetValue("ViPostIt:Title", value);
                RaisePropertyChangedEvent("Title");
            }
        }

        public String MyStrokes
        {
            get
            {
                return GetValue<String>("anotoPad:strokes");
            }
            set
            {
                SetValue("anotoPad:strokes", value);
                RaisePropertyChangedEvent("MyStrokes");
            }
        }

        #region IRemoteUpdateable Members

        public void OnRemoteUpdate()
        {
            RaisePropertyChangedEvent("Title");
            RaisePropertyChangedEvent("MyStrokes");
        }

        #endregion

    }
}
